﻿
@{
    ViewBag.Title = "普通诊室";
    Layout = "~/Views/Shared/_Form.cshtml";
}


<form id="form1">
    <div class="container" style="margin-top: 10px; margin-left: 10px; margin-right: 10px;">
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane fade in active" style="padding-top: 20px; margin-right: 107px;" id="basicInfo">
                <table class="form">
                    <tr style="display:none;">
                        <td class="formTitle"><span class="required">*</span>组织机构编码：</td>
                        <td class="formValue ">
                            <input id="orgId" name="orgId" type="text" class="form-control required" />
                        </td>
                    </tr>
                    <tr>
                        <td class="formTitle"><span class="required">*</span>组织机构：</td>
                        <td class="formValue">
                            <input id="orgName" name="orgName" type="text" class="form-control required" disabled="disabled"/>
                        </td>
                    </tr>

                    <tr style="display:none;">
                        <td class="formTitle"><span class="required">*</span>科室编码：</td>
                        <td class="formValue">
                            <input id="ksCode" name="ksCode" type="text" class="form-control required"  />
                        </td>
                    </tr>
                    <tr>
                        <td class="formTitle"><span class="required">*</span>科室：</td>
                        <td class="formValue">
                            <input id="ksmc" name="ksmc" type="text" class="form-control required" disabled="disabled" />
                        </td>
                    </tr>
                    <tr>
                        <td class="formTitle"><span class="required">*</span>诊室数量：</td>
                        <td class="formValue">
                            <input id="zssl" name="zssl" type="number" class="form-control required" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</form>



<script>
    var ksCode = $.request("ksCode");
    $(function () {
        initControl();
        //绑定数据
        if (!!ksCode) {
            $.najax({
                url: "/Consult/InitConsultInfo",
                data: { ksCode: ksCode },
                dataType: "json",
                async: false,
                success: function (data) {
                    $("#form1").formSerialize(data);
                }
            });
        }
    });

    function initControl() {
        
    }
    

    function CreateNormalConsult() {
        if (!$('#form1').formValid()) {
            return false;
        }

        var postData = $("#form1").formSerialize();
        $.submitForm({
            url: "/Consult/CreateNormalConsult?ksCode=" + ksCode + "&zssl="+postData.zssl,
            //param: postData,
            success: function () {
                //$.currentWindow().$("#gridList").resetSelection();
                //$.currentWindow().$("#gridList").trigger("reloadGrid");
                $.currentWindow().$("#gridmxList").resetSelection();
                $.currentWindow().$("#gridmxList").trigger("reloadGrid");
            }
        })
    }
</script>